﻿using System.Windows;
using System.Windows.Input;

namespace estoque
{
    public class FocusMoveCommand : ICommand
    {
        UIElement element;

        public FocusMoveCommand(UIElement element)
        {
            this.element = element;
        }

        public bool CanExecute(object parameter)
        {
            return this.element != null;
        }

        public event System.EventHandler CanExecuteChanged;

        public void Execute(object parameter)
        {
            if (this.element != null)
            {
                this.element.Focus();
            }
        }
    }
}